There are two approaches for forwarding the frames of the Ethernet at present: Layer 2 Ethernet bridge and Layer 3 IP route. The Layer 2 Ethernet bridge refers to a method for searching the Destination Media Access Control (MAC) address forwarding table by using the MAC address to obtain the exit information and forwarding the data packets according to the exit information. The Layer 3 IP route is a method for searching the routing table by using the destination IP to obtain the exit information and forwarding the data packets according to the exit information. The MAC address forwarding table is obtained through the self-learning of source MAC (SMAC) address or statically configured by software.
At present, as defined in the Ethernet bridge forwarding standard, one Virtual Switching Instance (VSI) corresponds to one Virtual Local Access Network (VLAN) in one access domain. The Layer 2 Ethernet bridge forwarding is forwarding the frames within one VLAN, and if the frames need to be forwarded between different VLANs, the forwarding must be implemented through the Layer 3 IP routing.
FIG. 1 is a flow chart illustrating the bridge forwarding within one VLAN in the prior art. As shown in FIG. 1, the MAC address forwarding table is searched by using the destination MAC address and the VLAN Identifier (ID), the exit information is obtained, and the frames are forwarded according to the exit information. The main procedure of bridge forwarding includes the following steps:
Step 101: Receiving the frame from the input port, and obtaining the input VLAN ID of the frame.
Step 102: The self-learning of SMAC address is implemented, i.e., recording the input port corresponding to the SMAC address in the MAC address forwarding table corresponding to the VLAN ID.
Step 103: Searching the MAC address forwarding table corresponding to the VLAN ID by using the destination MAC (DMAC) address obtained from the frame.
Step 104: If the searching result in the step 103 is the unicast forwarding, performing the step 105; if the searching result in the step 103 is the multicast forwarding, performing the step 106; if the searching result is not hit, performing the step 108.
Step 105: Searching the MAC address forwarding table to obtain the output port, and then proceeding to the step 110.
Step 106: Searching the MAC address forwarding table to obtain the Multicast ID (MID).
Step 107: Searching the Multicast table by using the MID to obtain a set of the output port, and then proceeding to the step 110.
Step 108: Determining to forward the frame with the broadcast mode.
Step 109: Obtaining all the output ports corresponding to the VLAN in which the input ports locates, and proceeding to the step 110.
Step 110: Determining whether the output port is the same as the input port, if so, proceeding to the step 111; otherwise, proceeding to the step 112.
Step 111: Abandoning the frames to prevent forwarding loops.
Step 112: Forwarding the frame to the output port.
The above-mentioned input port and output port correspond to one VSI, and the relationship between the VLAN and the VSI is one-to-one relationship.
Since in one access domain, the relationship between the VLAN and the VSI is one-to-one relationship, and the multiple-to-one relationship between multiple VLANs with one VSI is not supported, the Ethernet frames can only be forwarded within one VLAN by means of Layer 2 Ethernet bridge forwarding. If the frames need to be forwarded across VLANs, the Layer 3 IP routing must be adopted. In addition, the Ethernet frames can only be broadcasted to one VLAN by means of bridge forwarding, and broadcasting to multiple VLANs by means of bridge forwarding is not supported.